package com.xx.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("purchase_order_details")
public class PurchaseOrderDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    @TableId("order_id")
    private String orderId;

    /**
     * 商品ID
     */
    @TableId("product_id")
    private Integer productId;

    /**
     * 供应商ID
     */
    private Integer supplierId;
    /**
     * 数量
     */
    private Integer quantity;
    /**
     * 单价
     */
    private Double unitPrice;
    /**
     * 小计
     */
    private Double subtotal;
    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    private LocalDateTime deletedAt;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 最后修改人
     */
    private String updatedBy;

    /**
     * 版本
     */
    private Integer version;

    public PurchaseOrderDetails(String orderId, Integer productId,
                                Integer quantity, Double unitPrice,
                                Integer supplierId, Double subtotal){
        this.orderId = orderId;
        this.productId = productId;
        this.quantity = quantity;
        this.unitPrice = unitPrice;
        this.supplierId = supplierId;
        this.subtotal = subtotal;
    }
}
